Skip to content

Suppress errors when reading Git aliases#73

Open
AlexWaygood wants to merge 1 commit into
djui:masterfrom
AlexWaygood:alex/suppress-git-config-errors
Open

Suppress errors when reading Git aliases#73
AlexWaygood wants to merge 1 commit into
djui:masterfrom
AlexWaygood:alex/suppress-git-config-errors

Conversation

@AlexWaygood

@AlexWaygood AlexWaygood commented Jun 20, 2026

Copy link
Copy Markdown

Summary

Suppress stderr from the best-effort git config --get-regexp "^alias\." lookup.

The lookup currently runs before every command and ignores Git's exit status. If the shell's current working directory has been deleted, Git emits fatal: Unable to read current working directory: No such file or directory even though alias-tips continues normally and the command may recover, for example by changing to an absolute directory. This was kind-of confusing to me -- something "fatal" happened? But the command I entered into the terminal succeeded and exited with code 0?

Because this lookup already treats failure as “no Git aliases”, suppressing its stderr makes the visible behavior consistent with its failure handling.

@AlexWaygood AlexWaygood marked this pull request as ready for review June 20, 2026 11:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant